package com.yjd.pub.resource.dao.impl;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.resource.model.OrderPicsModel;
import com.yjd.comm.resource.model.ResourceModel;
import com.yjd.pub.resource.dao.IResourceDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：图片资源数据访问层 <br>
 * <b>time</b>：2017-06-27 08:57:02 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("resourceDao")
public class ResourceDaoImpl extends BaseDaoImpl implements IResourceDao {

	private static final String SQLMAPNAMESPACE = ResourceModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	/**
	 * 查询订单下所有的项目的图片
	 *
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<OrderPicsModel> getPicsListByOrdeId(Map<String,Object> param) throws Exception {
		return (List<OrderPicsModel>) this.getSqlMap(false).queryForList(getStatement("getPicsListByOrdeId"),param);
	}
}
